package com.web.productservice.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


    @RestController
    public class HelloController {
        @SentinelResource(value = "hello",blockHandler = "handleHello",blockHandlerClass = ExceptionHandle.class)

        @GetMapping("/hello")
        public String hello(){
            System.out.println(Thread.currentThread().getName()+"===>"+System.currentTimeMillis());
            return "hello sentinel!!";
        }


        @RestController
        public class OrderController {

            @GetMapping("/order")
            public String order(){
                return "这是订单接口!";
            }

            @GetMapping("/payment")
            public String payment(){
                return "这是支付接口!";
            }
        }
    }

